#ifndef _IPT_IPCONTEXT_H_
#define _IPT_IPCONTEXT_H_

#ifndef IPT_IPCONTEXT_DEBUG
#define IPT_IPCONTEXT_DEBUG 
#endif


#define REGEXP_SIZE   	250
#define PROTOCOL_SIZE   50

#define IPCONTEXT_PORT     0x001
#define IPCONTEXT_PROTOCOL 0x002
#define IPCONTEXT_LOG      0x010
#define IPCONTEXT_REGEXP   0x020
#define IPCONTEXT_IN	   0x040

struct ipt_context_info {
	int port;
	char protocol[PROTOCOL_SIZE];
	char regular_exp[REGEXP_SIZE];   
	int isCompiled;
	u_int8_t flags;
};
/* end */


#define IS_LOG(ptr)         ( (ptr)->flags & IPCONTEXT_LOG )
#define IS_DIRECTION_IN(ptr)   ( (ptr)->flags & IPCONTEXT_IN  )

#undef PDEBUG             /* undef it, just in case */
#undef PDEBUG_WARN

 
#ifdef IPT_IPCONTEXT_DEBUG

#ifdef __KERNEL__
     /* This one if debugging is on, and kernel space */
#    define PDEBUG(fmt, args...) printk( KERN_DEBUG "ipcontext:" fmt, ## args)
#    define PDEBUG_WARN(fmt, args...) printk( KERN_WARNING fmt, ## args)

#else
     /* This one for user space */
#    define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)

#endif

#else
#  define PDEBUG(fmt, args...) /* not debugging: nothing */
#  define PDEBUG_WARN(fmt, args...) /* not debugging: nothing */
#endif



#endif


